package com.ypinkj.app.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author LF
 * @date 2020/10/11 - 10:23
 */
@Configuration
public class StaticConfig extends WebMvcConfigurerAdapter {
    //静态资源
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry resourceHandler){
        resourceHandler.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
        resourceHandler.addResourceHandler("/templates/**").addResourceLocations("classpath:/templates/");
        super.addResourceHandlers(resourceHandler);
    }
}
